package com.licheng.mapper;

import com.licheng.pojo.Emp;
import com.licheng.pojo.EmpLoginLog;
import com.licheng.pojo.LoginInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LoginMapper {
    /**
     * 登录
     *
     * @param emp
     * @return
     */
    @Select("select id,username,name from emp where username = #{username} and password=#{password}")
    LoginInfo login(Emp emp);

    /**
     * 插入登录日志
     * @param empLoginLog
     */
    @Insert("insert into emp_login_log value(null,#{username}," +
            "#{password},#{loginTime},#{isSuccess},#{jwt},#{costTime}) ")
    void insertLoginLog(EmpLoginLog empLoginLog);
}
